home *** CD-ROM | disk | FTP | other *** search
- /** $VER: Autodoc.ttx 1.0 (5.Aug.91)
- ** Written by David N. Junod
- **
- ** Display hypertext Autodoc page.
- **
- ** Add the following lines to your S:user-startup file.
- **
- ** RX "AddLib('amigaguide.library',0,-30)"
- ** RX "LoadXRef('autodocs.xref')"
- **
- ** 23/09/93 - adapted for the WRITE editor by MGR, Asgard - Lars Hanke
- ** 07/02/94 - eliminated AmigaGuide programs calls and replaced them by
- ** amigaguide.library calls.
- **
- **/
-
- OPTIONS RESULTS
-
- IF ~SHOW('P','WRITE') then
- do
- say "This script is for use with the WRITE editor"
- say "Use AUTODOC.REXX from CLI."
- exit 0
- end
-
- address 'WRITE'
-
- 'VERSIONCHECK 31090 "autodoc.wrx"'
- IF RC~=0 THEN DO
- exit 10
- END
-
-
- 'GetVar (_CurrentWord)'
- word = RESULT
- err = RC
- do while ((word = "RESULT") & (err = 0))
- 'CursorLeft 0'
- err = RC
- 'GetVar (_CurrentWord)'
- word = RESULT
- end
- if err ~= 0 then
- do
- 'MessageOK (You must have a word in the active window!)'
- exit 0
- end
-
- 'GetVar (_FilePath)'
- path = RESULT
-
- call pragma(DIRECTORY,path)
-
- IF ~SHOW('L','amigaguide.library') THEN
- CALL ADDLIB('amigaguide.library',0,-30)
-
- /* See if the Autodoc cross-reference table is loaded */
- line = GetXRef("OpenWindow()")
- IF line = 10 THEN DO
-
- /* The Autodoc table wasn't loaded, so load it. */
- call LoadXRef(autodocs.xref)
- END
-
- /* See if the word is in the cross-reference table */
- function = word
- xref = 0
- line = GetXRef(function)
- IF line = 10 THEN DO
- /* Add the parens to the name */
- function = word||"()"
-
- /* Try again */
- line = GetXRef(function)
- IF line = 10 THEN DO
- function = word
- END
- ELSE DO
- xref = 1
- END
- END
- ELSE DO
- xref = 1
- END
-
- if line ~= 10 then
- do
- parse var line node file xref offset
- node = compress(node,'"')
- file = compress(file,'"')
- call ShowNode(,file,node,offset,xref)
- end
- else do
- cmd = "run MultiView "||function
- ADDRESS COMMAND cmd
- END
-
-